home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / menus.c < prev    next >
C/C++ Source or Header  |  1996-01-30  |  15KB  |  604 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. /*  Menus.c  */
  21.  
  22. #include <externs.h>
  23.  
  24.  
  25. /************************************************************************/
  26. /***   Inicializa o Mouse no Video                                    ***/
  27. /*                                                                      */
  28. void AVL_MOUSE_INIT()
  29. {
  30.     union REGS inreg, outreg;
  31. return;
  32.     inreg.x.ax = 0;
  33.     int86(0x33, &inreg, &outreg);
  34.     inreg.x.ax = 1;
  35.     int86(0x33, &inreg, &outreg);
  36. }
  37.  
  38. void AVL_MOUSE_ON()
  39. {
  40.     union REGS inreg, outreg;
  41. return;
  42.     inreg.x.ax = 1;
  43.     int86(0x33, &inreg, &outreg);
  44. }
  45.  
  46. void AVL_MOUSE_OFF()
  47. {
  48.     union REGS inreg, outreg;
  49. return;
  50.     inreg.x.ax = 2;
  51.     int86(0x33, &inreg, &outreg);
  52. }
  53.  
  54.  
  55. void AVL_MOUSE_SET(int x, int y)
  56. {
  57.     union REGS inreg, outreg;
  58. return;
  59.     inreg.x.ax = 4;
  60.     inreg.x.cx = x;
  61.     inreg.x.dx = y;
  62.     int86(0x33, &inreg, &outreg);
  63. }
  64.  
  65.  
  66. /************************************************************************/
  67. /***   Fornece o Status do Mouse - Posicao, Botao Precionado.            ***/
  68. /**    Botoes: 0 - esquerda                                            **/
  69. /*             1 - direita          Obs.: Definir estrutura de volta    */
  70. /*             2 - meio                   fora do programa.  xmouse     */
  71. /*                                                           ymouse     */
  72. /*    Retorna:  1 - se botao pressionado                                */
  73. /*              0 - caso contrario ou se nro. do botao for invalido     */
  74. /*                                                                      */
  75. AVL_MOUSE AVL_MOUSE_STATUS()
  76. {
  77.     union REGS inreg, outreg;
  78.     static AVL_MOUSE m;
  79.     short i;
  80. m.status = 0;
  81. return m;
  82.  
  83.     inreg.x.ax = 3;
  84.     inreg.x.bx = 0;
  85.  
  86.     int86(0x33, &inreg, &outreg);
  87.  
  88.     m.x = outreg.x.dx;
  89.     m.y = outreg.x.cx;
  90.     m.x = m.x / 8 + 1;
  91.     m.y = m.y / 8 + 1;
  92.     m.status = outreg.x.bx;
  93.  
  94.     return(m);
  95. }
  96.  
  97.  
  98.  
  99. int AVL_MOUSE_SELECT(int x1, int y1, int x2, int y2, int *row)
  100. {
  101.     AVL_MOUSE m;
  102.     m = AVL_MOUSE_STATUS();
  103. return 0;
  104.     if (m.x >= x1 && m.x <= x2 && m.y >= y1 && m.y <= y2 && m.status == 1) {
  105.         *row = m.x - x1;
  106.         avl_cur_smenu[avl_cur_menu] = *row;
  107.         AVL_SHOW_SMENU();
  108.         return 1;
  109.         }
  110.     return 0;
  111. }
  112.  
  113. int AVL_MOUSE_SELECT2(int *item)
  114. {
  115.     AVL_MOUSE m;
  116.     short k, y1, y2;
  117.     m = AVL_MOUSE_STATUS();
  118. return 0;
  119.     if (m.x == 2 && m.status == 1)  
  120.         for(k = 0; k < AVL_MENU_ITEMS; ++k)    {
  121.             y1 = avl_menu[k].c + 1;
  122.             y2 = strlen(avl_menu[k].tit) + y1 - 1;
  123.             if (m.y >= y1 && m.y <= y2 && k != avl_cur_menu)   {
  124.                 *item = avl_menu[k].tit[0];
  125.                 avl_cur_menu = k;
  126.                 AVL_SHOW_MENU();
  127.                 return 1;
  128.                 }
  129.             }
  130.     *item = avl_menu[avl_cur_menu].tit[0];
  131.     return (m.status == 1) ? 1 : 0;
  132. }
  133.  
  134.  
  135. void AVL_SHOW_SMENU()
  136. {
  137.     int i, j, rows = 0, cols = 0;
  138.     short co;
  139.     for(i = 0; *(avl_smenu[avl_cur_menu].s[i].sm) != '\0'; ++i) {
  140.         _settextposition(avl_smenu[avl_cur_menu].r+i,1);
  141.         if (avl_cur_smenu[avl_cur_menu] == i)
  142.             co = _settextcolor(avl_men_ready);
  143.         else
  144.             co = _settextcolor(avl_men_letter);
  145.         _outmem(avl_smenu[avl_cur_menu].s[i].sm,1);
  146.         if (avl_cur_smenu[avl_cur_menu] != i)
  147.             _settextcolor(avl_men_word);
  148.         _outtext(avl_smenu[avl_cur_menu].s[i].sm + 1);
  149.         }
  150. }
  151.  
  152.  
  153. int AVL_GET_SMENU_OPT()
  154. {
  155.     int ch, i, j;
  156.     short att, c1;
  157.     int rows, cols;
  158.     AVL_WIN_PTR w = NULL;
  159.     AVL_SHOW_MENU();
  160.     AVL_COMP_SMENU(&rows,&cols);
  161.     AVL_MOUSE_ON();
  162.     AVL_MOUSE_SET(2,2);
  163.     avl_no_up_corner = 1;
  164.     c1 = avl_menu[avl_cur_menu].c - 1;
  165.     ch = 78 - (c1 + cols);
  166.     if (ch < 0) c1 += ch;
  167.     if (!(rows == 0 && cols == 0))
  168.         w = AVL_MAKE_WINDOW("",3,c1,rows+4,c1+cols+1,avl_men_bk_color,avl_wnd_color);
  169.     _settextcursor(0x2000);
  170.     while ( 1 ) {
  171.         if (w != NULL)
  172.             AVL_SHOW_SMENU();
  173.         _settextposition(1,1);
  174. again:
  175.         if (!kbhit())  {
  176.             if (AVL_MOUSE_SELECT(4,c1+1,rows+3,c1+cols,&i))  {
  177.                 AVL_DEL_WINDOW(w);
  178.                 if (avl_smenu[avl_cur_menu].s[i].ret_edit) {
  179.                     ch = 0;
  180.                     AVL_DEL_WINDOW(avl_env_win);
  181.                     AVL_RESTORE_ENV();
  182.                     }
  183.                 else
  184.                     ch = *(avl_smenu[avl_cur_menu].s[i].sm);
  185.                 avl_smenu[avl_cur_menu].s[i].proc();
  186. /*                if ((avl_cur_menu == 0) && (avl_cur_smenu[avl_cur_menu] == 3))
  187.                     AVL_BORDER(" GWAda Development Environment ",1,1,3,80,avl_men_bk_color,avl_wnd_color);
  188. */
  189.                 avl_no_up_corner = 0;
  190.                 AVL_MOUSE_OFF();
  191.                 return ch;
  192.                 }
  193.             goto again;
  194.             }
  195.         ch = getch();
  196.         ch = toupper(ch);
  197.         if (ch >= 'A' && ch <= 'Z')   {
  198.             if (w == NULL)  {
  199.                 AVL_ERROR("Invalid action");
  200.                 continue;
  201.                 }
  202.             for (i = 0; i < rows; ++i)
  203.                 if (*(avl_smenu[avl_cur_menu].s[i].sm) == ch) {
  204.                     avl_cur_smenu[avl_cur_menu] = i;
  205.                     AVL_DEL_WINDOW(w);
  206.                     if (avl_smenu[avl_cur_menu].s[i].ret_edit) {
  207.                         ch = 0;
  208.                         AVL_DEL_WINDOW(avl_env_win);
  209.                         AVL_RESTORE_ENV();
  210.                         }
  211.                     avl_smenu[avl_cur_menu].s[i].proc();
  212. /*                    if ((avl_cur_menu == 0) && (avl_cur_smenu[avl_cur_menu] == 3))
  213.                         AVL_BORDER(" GWAda Development Environment ",1,1,3,80,avl_men_bk_color,avl_wnd_color);
  214. */
  215.                     avl_no_up_corner = 0;
  216.                     AVL_MOUSE_OFF();
  217.                     return ch;
  218.                     }
  219.             continue;
  220.             }
  221.         else {
  222.             switch( ch ) {
  223.                 case  27  : /* Abort Menu */
  224.                     AVL_DEL_WINDOW(w);
  225.                     avl_no_up_corner = 0;
  226.                     AVL_MOUSE_OFF();
  227.                     return 1;
  228.                 case  13  : /* Engage current selection */
  229.                     AVL_DEL_WINDOW(w);
  230.                     ch =  *(avl_smenu[avl_cur_menu].s[avl_cur_smenu[avl_cur_menu]].sm);
  231.                     if (avl_smenu[avl_cur_menu].s[avl_cur_smenu[avl_cur_menu]].ret_edit) {
  232.                         ch = 0;
  233.                         AVL_DEL_WINDOW(avl_env_win);
  234.                         AVL_RESTORE_ENV();
  235.                         }
  236.                     avl_smenu[avl_cur_menu].s[avl_cur_smenu[avl_cur_menu]].proc();
  237. /*                    if ((avl_cur_menu == 0) && (avl_cur_smenu[avl_cur_menu] == 3))
  238.                         AVL_BORDER(" GWAda Development Environment ",1,1,3,80,avl_men_bk_color,avl_wnd_color);
  239. */
  240.                     avl_no_up_corner = 0;
  241.                     AVL_MOUSE_OFF();
  242.                     return ch;
  243.                 case 0   : 
  244.                 case 0XE0: {
  245.                     ch = getch();
  246.                     switch(ch)  {
  247.                         case 72 : /* Up  */ 
  248.                             if (avl_cur_smenu[avl_cur_menu] > 0)
  249.                                 --avl_cur_smenu[avl_cur_menu];
  250.                             else
  251.                                 avl_cur_smenu[avl_cur_menu] = rows - 1;
  252.                             break;
  253.                         case 80 : /* Down */ 
  254.                             if (avl_cur_smenu[avl_cur_menu] < (rows - 1))
  255.                                 ++avl_cur_smenu[avl_cur_menu];
  256.                             else
  257.                                 avl_cur_smenu[avl_cur_menu] = 0;
  258.                             break;
  259.                         case 75 : /* Left  */ 
  260.                             if (avl_cur_menu > 0) 
  261.                                 --avl_cur_menu; 
  262.                             else
  263.                                 avl_cur_menu = 8;
  264.                             AVL_DEL_WINDOW(w);
  265.                             w = NULL;
  266.                             AVL_SHOW_MENU();
  267.                             AVL_COMP_SMENU(&rows,&cols);
  268.                             c1 = avl_menu[avl_cur_menu].c - 1;
  269.                             ch = 78 - (c1 + cols);
  270.                             if (ch < 0) c1 += ch;
  271.                             if (!(rows == 0 && cols == 0))
  272.                                 w = AVL_MAKE_WINDOW("",3,c1,rows+4,c1+cols+1,avl_men_bk_color,avl_wnd_color);
  273.                             _settextcursor(0x2000);
  274.                             break;
  275.                         case 77 : /* Right */ 
  276.                             if (avl_cur_menu < 8) 
  277.                                 ++avl_cur_menu; 
  278.                             else
  279.                                 avl_cur_menu = 0;
  280.                             AVL_DEL_WINDOW(w);
  281.                             w = NULL;
  282.                             AVL_SHOW_MENU();
  283.                             AVL_COMP_SMENU(&rows,&cols);
  284.                             c1 = avl_menu[avl_cur_menu].c - 1;
  285.                             ch = 78 - (c1 + cols);
  286.                             if (ch < 0) c1 += ch;
  287.                             if (!(rows == 0 && cols == 0))
  288.                                 w = AVL_MAKE_WINDOW("",3,c1,rows+4,c1+cols+1,avl_men_bk_color,avl_wnd_color);
  289.                             else
  290.                                 w = NULL;
  291.                             _settextcursor(0x2000);
  292.                             break;
  293.                         default : putch(7); break;
  294.                         }
  295.                     break;
  296.                     }
  297.                 default : putch(7); break;
  298.                 }
  299.             }
  300.         }  /*  While  */
  301. }
  302.  
  303. char env_saved = 0;
  304.  
  305. void AVL_SAVE_ENV()
  306. {
  307.     AVL_EDIT_WINDOW_PTR wa;
  308.     env_saved = '1';
  309.     wa = &avl_windows[avl_window];
  310.     wa -> sw.bk = _getbkcolor();
  311.     wa -> sw.co = _gettextcolor();
  312.     memmove(wa -> sw.video, 0xb8000, 4000);
  313.     _gettextwindow(&wa -> sw.r1,&wa -> sw.c1,&wa -> sw.r2,&wa -> sw.c2);
  314.     wa -> sw.pos = _gettextposition();
  315. }
  316.  
  317. void AVL_RESTORE_ENV()
  318. {
  319.     AVL_EDIT_WINDOW_PTR wa;
  320.     short *s, *d;
  321.     char *p;
  322.     unsigned char c, att;
  323.     short i, j;
  324. /*    if (!env_saved) return;
  325. */
  326.     env_saved = '\0';        
  327.     wa = &avl_windows[avl_window];
  328.     d = (short *) 0xb8000;
  329.     p =  wa -> sw.video;
  330.     s = (short *) p;
  331.     for(i = 0; i < 2000; ++i) {
  332.         c = *s;
  333.         att = *s >> 8;        
  334.         AVL_WVIDEO(c,att,d);
  335.         ++s;
  336.         ++d;
  337.         }
  338. /*    memmove(0xb8000, wa -> sw.video, 4000);
  339. */    _settextwindow(wa -> sw.r1,wa -> sw.c1,wa -> sw.r2,wa -> sw.c2);
  340.     _setbkcolor(wa -> sw.bk);
  341.     _settextcolor(wa -> sw.co);
  342.     _settextposition(wa -> sw.pos.row, wa -> sw.pos.col);
  343. }
  344.  
  345.  
  346. void AVL_DO_WINDOW()
  347. {
  348. }
  349.  
  350.  
  351. void AVL_ENVIRONMENT(int key)
  352. {
  353.     int ch, opt;
  354.     short att;
  355.     AVL_WIN_PTR w = NULL;
  356.     AVL_SAVE_ENV();
  357.     avl_env_win = NULL;
  358.     if (avl_open_error_file)  {
  359.         avl_open_error_file = 0;
  360.         avl_cur_menu = 0; 
  361.         AVL_OPEN_ERROR();
  362.         AVL_FIND(1,"*** ERROR: ");
  363.         return;
  364.         }
  365.     att = _settextcursor(0x2000);  /*  turn cursor off */
  366.     w = avl_env_win = AVL_MAKE_WINDOW(" GWAda Development Environment ",1,1,3,80,avl_men_bk_color,avl_wnd_color);
  367.     if (key) {
  368.         switch( key ) {
  369.             case 'F' : avl_cur_menu = 0; break;
  370.             case 'E' : avl_cur_menu = 1; break;
  371.             case 'C' : avl_cur_menu = 2; break;
  372.             case 'B' : avl_cur_menu = 3; break;
  373.             case 'R' : avl_cur_menu = 4; break;
  374.             case 'W' : avl_cur_menu = 5; break;
  375.             case 'O' : avl_cur_menu = 6; break;
  376.             case 'A' : avl_cur_menu = 7; break;
  377.             case 'H' : avl_cur_menu = 8; break;
  378.             default  : {
  379.                 if (key == 0) key = getch();
  380.                 key = 0;
  381.                 AVL_ERROR("Invalid selection");
  382.                 break;
  383.                 }
  384.             }
  385.         }
  386.     while ( 1 ) {
  387.  
  388.         AVL_SHOW_MENU(); /*  Display top menu  */
  389.         AVL_MOUSE_ON();
  390.         AVL_MOUSE_SET(2,2);
  391.         _settextcursor(0x2000);
  392.         _settextposition(1,1);
  393.         if (key) {
  394.             ch = key;
  395.             key = 0;
  396.             }
  397.         else  
  398.             if (!kbhit())   {
  399.         
  400.                 if (!AVL_MOUSE_SELECT2(&ch))  
  401.                     continue;
  402.                 }
  403.             else {
  404.                 ch = getch();
  405.                 ch = toupper(ch);
  406.                 }
  407. back_here:
  408.         switch( ch ) {
  409.             case  27  : /* ESC : Abort Menu */
  410.                 _settextcursor(att);
  411.                 AVL_DEL_WINDOW(w);
  412.                 AVL_RESTORE_ENV();
  413.                 AVL_MOUSE_OFF();
  414.                 return;
  415.             case  13  : /* Engage current selection */
  416.                 AVL_SHOW_MENU();
  417.                 if (avl_cur_menu == 3)  {
  418.                     AVL_BIND();
  419.                     _settextcursor( att );
  420.                     break;
  421.                     }
  422.                 if (avl_cur_menu == 4)  {
  423.                     AVL_RUN();
  424.                     _settextcursor( att );
  425.                     break;
  426.                     }
  427.                 if (avl_cur_menu == 5)  {
  428.                     AVL_WINDOW();
  429.                     AVL_DEL_WINDOW(w);
  430.                     AVL_RESTORE_ENV();
  431.                     AVL_MOUSE_OFF();
  432.                     return;
  433.                     }
  434.                 opt = AVL_GET_SMENU_OPT();
  435.                 if (avl_cur_menu == 2 && avl_open_error_file)  {
  436.                     AVL_DEL_WINDOW(w);
  437.                     AVL_RESTORE_ENV();
  438.                     AVL_MOUSE_OFF();
  439.                     return;
  440.                     }
  441.                 _settextcursor( att );
  442.                 if (opt == 0)  {
  443.                     AVL_MOUSE_OFF();
  444.                     return;
  445.                     }
  446.                 break;
  447.             case 'F' : 
  448.                 avl_cur_menu = 0;
  449.                 AVL_SHOW_MENU();
  450.                 opt = AVL_GET_SMENU_OPT();
  451.                 _settextcursor( att );
  452.                 if (opt == 0)  {
  453.                     AVL_MOUSE_OFF();
  454.                     return;
  455.                     }
  456.                 break;
  457.             case 'E' : 
  458.                 avl_cur_menu = 1;
  459.                 AVL_SHOW_MENU();
  460.                 opt = AVL_GET_SMENU_OPT();
  461.                 _settextcursor( att );
  462.                 if (opt == 0)  {
  463.                     AVL_MOUSE_OFF();
  464.                     return;
  465.                     }
  466.                 break;
  467.             case 'C' : 
  468.                 avl_cur_menu = 2;
  469.                 AVL_SHOW_MENU();
  470.                 opt = AVL_GET_SMENU_OPT();
  471.                 if (avl_open_error_file)  {
  472.                     AVL_DEL_WINDOW(w);
  473.                     AVL_RESTORE_ENV();
  474.                     AVL_MOUSE_OFF();
  475.                     return;
  476.                     }
  477.                 _settextcursor( att );
  478.                 if (opt == 0)  {
  479.                     AVL_MOUSE_OFF();
  480.                     return;
  481.                     }
  482.                 break;
  483.             case 'B' :  /* Bind */
  484.                 avl_cur_menu = 3;
  485.                 AVL_SHOW_MENU();
  486.                 AVL_BIND();
  487.                 _settextcursor( att );
  488.                 break;
  489.             case 'R' : 
  490.                 avl_cur_menu = 4;
  491.                 AVL_SHOW_MENU();
  492.                 AVL_RUN();
  493.                 _settextcursor( att );
  494.                 break;
  495.             case 'W' : 
  496.                 avl_cur_menu = 5;
  497.                 AVL_SHOW_MENU();
  498.                 AVL_WINDOW();
  499.                 AVL_DEL_WINDOW(avl_env_win);
  500.                 AVL_RESTORE_ENV();
  501.                 AVL_MOUSE_OFF();
  502.                 return;
  503.             case 'O' :
  504.                 avl_cur_menu = 6;
  505.                 AVL_SHOW_MENU();
  506.                 opt = AVL_GET_SMENU_OPT();
  507.                 _settextcursor( att );
  508.                 if (opt == 0)  {
  509.                     AVL_MOUSE_OFF();
  510.                     return;
  511.                     }
  512.                 break;
  513.             case 'A' :
  514.                 avl_cur_menu = 7;
  515.                 AVL_SHOW_MENU();
  516.                 opt = AVL_GET_SMENU_OPT();
  517.                 _settextcursor( att );
  518.                 if (opt == 0)  {
  519.                     AVL_MOUSE_OFF();
  520.                     return;
  521.                     }
  522.                 break;
  523.             case 'H' : 
  524.                 avl_cur_menu = 8;
  525.                 AVL_SHOW_MENU();
  526.                 opt = AVL_GET_SMENU_OPT();
  527.                 _settextcursor( att );
  528.                 if (opt == 0)  {
  529.                     AVL_MOUSE_OFF();
  530.                     return;
  531.                     }
  532.                 break;
  533.             case 0   : 
  534.             case 0XE0: {
  535.                 ch = getch();
  536.                 switch(ch)  {
  537.                     case 75 : /* Left  */ 
  538.                         if (avl_cur_menu > 0) 
  539.                             --avl_cur_menu; 
  540.                         else
  541.                             avl_cur_menu = 8;
  542.                         break;
  543.                     case 77 : /* Right */ 
  544.                         if (avl_cur_menu < 8) 
  545.                             ++avl_cur_menu; 
  546.                         else
  547.                             avl_cur_menu = 0;
  548.                         break;
  549.                     case 33 : /* File */ ch = 'F'; goto back_here;
  550.                     case 18 : /* Edit */ ch = 'E'; goto back_here;
  551.                     case 46 : /* Comp */ ch = 'C'; goto back_here;
  552.                     case 48 : /* Bind */ ch = 'B'; goto back_here;
  553.                     case 19 : /* Run  */ ch = 'R'; goto back_here;
  554.                     case 17 : /* Wind */ ch = 'W'; goto back_here;
  555.                     case 24 : /* Opti */ ch = 'O'; goto back_here;
  556.                     case 30 : /* Ada  */ ch = 'A'; goto back_here;
  557.                     case 35 : /* Help */ ch = 'H'; goto back_here;
  558.                     case 59 : /* F1   */ AVL_HOT_KEYS(); break;
  559.                     case 107: /* Alt-F4   */ AVL_EXIT(); 
  560.                                              AVL_MOUSE_OFF();
  561.                                              return;
  562.                     default : putch(7); break;
  563.                     }
  564.                 }
  565.             }
  566.         }
  567. }
  568.  
  569. void AVL_COMP_SMENU(int *rows, int *cols)
  570. {
  571.     int i, j;
  572.     *rows = *cols = 0;
  573.     for(i = 0; *(avl_smenu[avl_cur_menu].s[i].sm) != '\0'; ++i) {
  574.         j = strlen(avl_smenu[avl_cur_menu].s[i].sm);
  575.         *rows += 1;
  576.         if (j > *cols) *cols = j;
  577.         }
  578. }
  579.  
  580.  
  581. void AVL_SHOW_MENU()
  582. {
  583.     int i;
  584.     short co;
  585.  
  586.     for (i = 0; i < AVL_MENU_ITEMS; ++i)  {
  587.         _settextposition(avl_menu[i].r,avl_menu[i].c);
  588.         if (i != 9)
  589.             if (i == avl_cur_menu)
  590.                 co = _settextcolor(avl_men_ready);
  591.             else
  592.                 co = _settextcolor(avl_men_letter);
  593.         else 
  594.             co = _settextcolor(15);
  595.         _outmem(avl_menu[i].tit,1);
  596.         if ((i != 9) && (i != avl_cur_menu))
  597.             _settextcolor(avl_men_word);
  598.         _settextposition(avl_menu[i].r,avl_menu[i].c+1);
  599.         _outtext(avl_menu[i].tit+1);
  600.         _settextcolor(co);
  601.         }
  602. }
  603.  
  604.